home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FNTNS / SQRT2.HLP < prev    next >
Text File  |  1989-01-24  |  803b  |  28 lines

  1.          Name: SQRT2.ASM
  2.          Type: Assembler Macro
  3.       Version: 1.0
  4.   Last Change: 26-Jan-87
  5.  
  6.   Description: Square Root Approximation (10 bit accuracy)
  7.  
  8.  This will take the square root of a number by polynomial approximation.
  9.  
  10.           sqrt(x)=-.1985987*x*x+.8803385*x+.3175231
  11.  
  12.  This polynomial will give approximately 10 significant bits of accuracy.
  13.  This is valid for:  .5<= x < 1.0
  14.  
  15.  The input value is put into x0, the output value is returned in register
  16.  A.  Register R1 initially points to the coefficients in y memory in the
  17.  order:a1,a2,a0.
  18.  
  19.        R1
  20.        |
  21.        v
  22.  y:.8803385,-.1985987,.3185231
  23.  
  24.        a1       a2       a0
  25.  
  26.  Benchmarks for this macro is 4 cycles, 4 instructions.
  27.  The library program SQRT2T demonstrates how to use the SQRT2 macro.
  28.